import Vue from 'vue'
import VueRouter from 'vue-router'

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'Home',
        component: () => import('../views/home.vue')
    }, {
        path: '/home',
        name: 'Home',
        component: () => import('../views/home.vue')
    }, {
        path: '/virus',
        name: 'Virus',
        component: () => import('../views/browse/virus.vue')
    },
    // {
    //     path: '/rnaType',
    //     name: 'RnaType',
    //     component: () => import('../views/browse/rnaType.vue')
    // },
    {
        path: '/browse/host',
        name: 'BrowseHost',
        component: () => import('../views/browse/host.vue')
    }, {
        path: '/hostOverviwe',
        name: 'HostOverviwe',
        component: () => import('../views/browse/hostOverviwe.vue')
    }, {
        path: '/browse/experiments',
        name: 'Experiments',
        component: () => import('../views/browse/experiments.vue')
    }, {
        path: '/download',
        name: 'Download',
        component: () => import('../views/download.vue')
    }, {
        path: '/viruslSearch',
        name: 'ViruslSearch',
        component: () => import('../views/viruslSearch.vue'),
        meta: { isSearchHide: true }
    }, {
        path: '/overview',
        name: 'Overview',
        component: () => import('../views/overview.vue')
    }, {
        path: '/help',
        name: 'Help',
        component: () => import('../views/help.vue')
    }, {
        path: '/statistic/virus',
        name: 'StatisticVirus',
        component: () => import('../views/statistic/virus.vue')
    }, {
        path: '/statistic/index',
        name: 'StatisticIndex',
        component: () => import('../views/statistic/index.vue')
    }, {
        path: '/statistic/host',
        name: 'StatisticHost',
        component: () => import('../views/statistic/host.vue')
    }, {
        path: '/statistic/host',
        name: 'StatisticHost',
        component: () => import('../views/statistic/host.vue')
    }, {
        path: '/search/quick',
        name: 'SearchQuick',
        component: () => import('../views/search/quick.vue')
    }, {
        path: '/search/sequence',
        name: 'SearchSequence',
        component: () => import('../views/search/sequence.vue')
    },
    {
        path: '/expRNA',
        name: 'ExpRNA',
        meta: {isKeep: false},
        component: () => import('../views/expression/expRNA.vue')
    },
    // {
    //     path: '/interaction/virus',
    //     name: 'InteractionVirus',
    //     meta: {isKeep: true},
    //     component: () => import('../views/interaction/virus.vue')
    // },
    {
        path: '/interaction/host',
        name: 'InteractionHost',
        component: () => import('../views/interaction/host.vue')
    }, {
        path: '/interaction/predict',
        name: 'InteractionPredict',
        component: () => import('../views/interaction/predict.vue')
    }, {
        path: '/interaction/nodeView',
        name: 'InteractionNodeView',
        component: () => import('../views/interaction/nodeView.vue')
    }


]

const router = new VueRouter({
    routes
})

export default router
